﻿// //  ********************************************************************************
// //  Copyright (C) 2016 Sebastian Kenter. All rights reserved.
// // 
// //  Name    : MultiServerEngine | ServerFramework | IServerPeerRegistry.cs
// //  Created : 2016 - 02 - 16 20:53
// //  Modified: 2016 - 02 - 20 12:33
// //  ********************************************************************************

using System.Collections.Generic;
using ExitGames.Logging;
using TypeDefs;

namespace ServerFramework.Interfaces.Server
{
    /// <summary>
    ///     Interface for the server peer registry holding all connected server peers for one server
    /// </summary>
    /// <typeparam name="TServerPeer">The type of the peer (normally IServerPeer)</typeparam>
    public interface IServerPeerRegistry<in TServerPeer>
    {
        ILogger Logger { get; }

        bool RegisterPeer(ServerTypes peerType, TServerPeer serverPeer);

        bool UnregisterServerPeer(ServerTypes peerType, TServerPeer serverPeer);

        Dictionary<ServerTypes, IServerPeer> GetServerPeers();

        IServerPeer GetServerPeerByType(ServerTypes serverType);
    }
}
